Function Reference

_AD_SetAccountExpire

Modifies the specified user or computer account expiration date/time or sets the account to never expire.

#Include <AD.au3>
_AD_SetAccountExpire($sObject, $sDateTime)

 

Parameters

$sObject User or computer account to set expiration date/time (sAMAccountName or FQDN)
$sDateTime Expiration date/time in format: yyyy-mm-dd hh:mm:ss (local time) or "01/01/1970" to never expire

 

Return Value

Success: 1
Failure: 0, sets @error to:
    1 - $sObject does not exist
    x - Error returned by SetInfo function (Missing permission etc.)

 

Remarks

Use the following syntax for the date/time:
01/01/1970 = never expire
yyyy-mm-dd hh:mm:ss= "international format" - always works
xx/xx/xx